export const readCookie = (key) => {
  if (!key || !key.trim()) return;

  const keyEqual = key + '=';
  const cookies = document.cookie.split(";");
  const cookie = cookies.find(n => n.trim().startsWith(keyEqual));
  return cookie && cookie.trim().substring(keyEqual.length);
}
